package com.bosch.in.rtp1.ept.util.ehcache;

import java.util.List;

import net.sf.ehcache.CacheManager;

import com.bosch.in.rtp1.ept.action.form.FrozenColumnForm;
import com.bosch.in.rtp1.ept.model.dto.BoxPlotFactor;
import com.bosch.in.rtp1.ept.model.dto.DurationColorCon;
import com.bosch.in.rtp1.ept.model.dto.FXFactor;
import com.bosch.in.rtp1.ept.model.dto.FshRcpChartValues;
import com.bosch.in.rtp1.ept.model.dto.FshRcpRecord;
import com.bosch.in.rtp1.ept.model.dto.HldDurByMonth;
import com.bosch.in.rtp1.ept.model.dto.HoldCodeFilter;
import com.bosch.in.rtp1.ept.model.dto.Link;
import com.bosch.in.rtp1.ept.model.dto.LotStatus;
import com.bosch.in.rtp1.ept.model.dto.RelHldChartFactor;
import com.bosch.in.rtp1.ept.model.dto.ReleasedHold;
import com.bosch.in.rtp1.ept.model.dto.SelectingString;
import com.bosch.in.rtp1.ept.model.dto.SkippedFshRcpCon;

/**
 * Provide singleton cache wrapper object for particular caching purpose.
 * @author TPR1HC
 *
 */
public class EhcacheFactory {
	
	/**
	 * Cache name for caching Lot Status
	 */
	private static final String LOT_STATUS_CACHE_NAME = "com.bosch.in.lotstatus";
	
	/**
	 * Cache name for caching Lot Status
	 */
	private static final String RELEASED_HOLD_CACHE_NAME = "com.bosch.in.releasedhold";
	
	/**
	 * Cache name for caching Lot Status
	 */
	private static final String HOLD_CODE_CACHE_NAME = "com.bosch.in.allholdcode";
	
	/**
	 * Cache name for caching Finished Recipes Diagram Factors
	 */
	private static final String FSH_RCP_FACTOR_CACHE_NAME = "com.bosch.in.fshRcpFactor";
	
	/**
	 * Cache name for caching Location List
	 */
	private static final String LOCATION_CACHE_NAME = "com.bosch.in.location";
	
	/**
	 * Cache name for caching Stage List
	 */
	private static final String STAGE_CACHE_NAME = "com.bosch.in.stage";
	
	/**
	 * Cache name for caching Stage List
	 */
	private static final String EQPTYPE_CACHE_NAME = "com.bosch.in.eqptype";
	
	/**
	 * Cache name for caching data for released hold diagram
	 */
	private static final String REL_HLD_DIAGRAM_CACHE_NAME = "com.bosch.in.relHldDiagram";
	
	/**
	 * Cache name for caching data for hold duration diagram
	 */
	private static final String HLD_DUR_DIAGRAM_CACHE_NAME = "com.bosch.in.hldDurDiagram";
	
	/**
	 * Cache name for caching data for frozen column configuration
	 */
	private static final String FRZ_COL_CACHE_NAME = "com.bosch.in.frozenColumns";
	
	/**
	 * Cache name for caching data for active hold diagram
	 */
	private static final String ACT_HLD_CACHE_NAME = "com.bosch.in.actHldDiagram";
	
	/**
	 * Cache name for caching data for duration color configuration
	 */
	private static final String DUR_COL_CACHE_NAME = "com.bosch.in.durColSetting";

	/**
	 * Cache name for caching data for skipped recipe configuration
	 */
	private static final String SKP_RCP_CACHE_NAME = "com.bosch.in.skippedRcpConfiguration";
	
	/**
	 * Cache name for caching data for finished recipe records
	 */
	private static final String FSH_RCP_RECORDS = "com.bosch.in.fshRcpRecords";
	
	/**
	 * Cache name for caching data for fx factor
	 */
	private static final String FX_FACTOR = "com.bosch.in.fxFactor";
	
	/**
	 * Cache name for caching data for link list
	 */
	private static final String LINK_LIST = "com.bosch.in.linkList";
	
	/**
	 * Singleton cache manager object
	 */
	private static CacheManager cacheManager = CacheManager.getInstance();
	
	/**
	 * Singleton cache wrapper object for caching Lot Status
	 */
	private static CacheWrapper<String, List<LotStatus>> lotStatusCache = new EhcacheWrapper<String, List<LotStatus>>(LOT_STATUS_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching Lot Status
	 */
	private static CacheWrapper<String, List<ReleasedHold>> releasedHoldCache = new EhcacheWrapper<String, List<ReleasedHold>>(RELEASED_HOLD_CACHE_NAME, cacheManager);
	
	
	/**
	 * Singleton cache wrapper object for caching Lot Status
	 */
	private static CacheWrapper<String, List<HoldCodeFilter>> holdCodeCache = new EhcacheWrapper<String, List<HoldCodeFilter>>(HOLD_CODE_CACHE_NAME, cacheManager);
	
	
	/**
	 * Singleton cache wrapper object for caching Lot FshRcpChartValues
	 */
	private static CacheWrapper<String, List<FshRcpChartValues>> fshRcpFactorCache = new EhcacheWrapper<String, List<FshRcpChartValues>>(FSH_RCP_FACTOR_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching Location
	 */
	private static CacheWrapper<String, List<SelectingString>> locationCache = new EhcacheWrapper<String, List<SelectingString>>(LOCATION_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching Stage
	 */
	private static CacheWrapper<String, List<SelectingString>> stageCache = new EhcacheWrapper<String, List<SelectingString>>(STAGE_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching EqpType
	 */
	private static CacheWrapper<String, List<SelectingString>> eqpTypeCache = new EhcacheWrapper<String, List<SelectingString>>(EQPTYPE_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for released hold diagram
	 */
	private static CacheWrapper<String, List<RelHldChartFactor>> relHldDiagram = new EhcacheWrapper<String, List<RelHldChartFactor>>(REL_HLD_DIAGRAM_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for released hold diagram
	 */
	private static CacheWrapper<String, List<HldDurByMonth>> hldDurDiagram = new EhcacheWrapper<String, List<HldDurByMonth>>(HLD_DUR_DIAGRAM_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for frozen column configuration
	 */
	private static CacheWrapper<String, FrozenColumnForm> frzColCache = new EhcacheWrapper<String, FrozenColumnForm>(FRZ_COL_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for active hold diagram
	 */
	private static CacheWrapper<String, List<BoxPlotFactor>> actHldCache = new EhcacheWrapper<String, List<BoxPlotFactor>>(ACT_HLD_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for duration color configuration
	 */
	private static CacheWrapper<String, DurationColorCon> durColCache = new EhcacheWrapper<String, DurationColorCon>(DUR_COL_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for skipped recipe configuration
	 */
	private static CacheWrapper<String, SkippedFshRcpCon> skpRcpConCache = new EhcacheWrapper<String, SkippedFshRcpCon>(SKP_RCP_CACHE_NAME, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for finished recipe records
	 */
	private static CacheWrapper<String, List<FshRcpRecord>> fshRcpRecords = new EhcacheWrapper<String, List<FshRcpRecord>>(FSH_RCP_RECORDS, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for fx factors
	 */
	private static CacheWrapper<String, List<FXFactor>> fxFactors = new EhcacheWrapper<String, List<FXFactor>>(FX_FACTOR, cacheManager);
	
	/**
	 * Singleton cache wrapper object for caching data for link list
	 */
	private static CacheWrapper<String, List<Link>> links = new EhcacheWrapper<String, List<Link>>(LINK_LIST, cacheManager);
	
	/**
	 * Get Lot Status Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<LotStatus>> getLotStatusEhcacheWrapper() {
		return lotStatusCache;
	}
	
	/**
	 * Get Released Hold Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<ReleasedHold>> getReleasedHoldEhcacheWrapper() {
		return releasedHoldCache;
	}
	
	/**
	 * Get Released Hold Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<HoldCodeFilter>> getHoldCodeEhcacheWrapper() {
		return holdCodeCache;
	}
	
	/**
	 * Get Lot Status Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<FshRcpChartValues>> getFshRcpFactorEhcacheWrapper() {
		return fshRcpFactorCache;
	}
	
	/**
	 * Get Locations Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<SelectingString>> getLocationEhcacheWrapper() {
		return locationCache;
	}
	
	/**
	 * Get Stages Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<SelectingString>> getStageEhcacheWrapper() {
		return stageCache;
	}
	
	/**
	 * Get EqpType Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<SelectingString>> getEqpTypeEhcacheWrapper() {
		return eqpTypeCache;
	}
	
	/**
	 * Get Released Hold  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<RelHldChartFactor>> getRelHldDiagramcacheWrapper() {
		return relHldDiagram;
	}
	
	/**
	 * Get Hold Duration  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<HldDurByMonth>> getHldDurDiagramcacheWrapper() {
		return hldDurDiagram;
	}
	
	/**
	 * Get frozenColumn  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, FrozenColumnForm> getFrzColcacheWrapper() {
		return frzColCache;
	}
	
	/**
	 * Get ActiveHold  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<BoxPlotFactor>> getActHldcacheWrapper() {
		return actHldCache;
	}
	
	/**
	 * Get DurationColorConditionForm  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, DurationColorCon> getDurColcacheWrapper() {
		return durColCache;
	}
	
	/**
	 * Get SkippedRecipeConfiguration  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, SkippedFshRcpCon> getSkippedRecipeCon() {
		return skpRcpConCache;
	}
	
	/**
	 * Get FshRcpRecords  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<FshRcpRecord>> getFshRcpRecords()
	{
		return fshRcpRecords;
	}
	
	/**
	 * Get FX Factors  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<FXFactor>> getFxFactorRecords()
	{
		return fxFactors;
	}
	
	/**
	 * Get LinkList  Ehcache
	 * @return
	 */
	public static CacheWrapper<String, List<Link>> getLinkList()
	{
		return links;
	}
}
